<template>
	<view class="dx-body">
		<dx-table ref="table" :buttons="['refresh', 'del']" :tableParams="tableParams"></dx-table>
	</view>
</template>

<script setup lang="ts">
import { reactive, ref, nextTick } from 'vue';
import { onLoad } from '@dcloudio/uni-app';
const tableParams = reactive({
	columnConfig: {
		resizable: true,
	},
	rowConfig: {
		isCurrent: false,
		isHover: true,
	},
	showOverflow: 'tooltip',
	urls: {
		index: 'logs/index',
		del: 'logs/del',
	},
	columns: [
		{ type: 'checkbox', width: '60px', operator: false },
		{ type: 'seq', field: 'seq', label: '序号', width: '60px', operator: false },
		{
			label: '用户名',
			field: 'username',
			minWidth: '100px',
		},
		{
			label: 'appid',
			field: 'appid',
			minWidth: '150px',
		},
		{
			label: 'ip',
			field: 'ip',
			minWidth: '150px',
		},
		{
			label: '类型',
			field: 'type',
			width: '80px',
		},
		{
			label: 'ua',
			field: 'ua',
			minWidth: '180px',
		},
		{
			label: '创建时间',
			field: 'create_date',
			form: false,
			formatter: 'dxFormatDate',
			width: '180px',
		},
		{
			type: 'operate',
			field: 'operate',
			label: '操作',
			width: '80px',
			fixed: 'right',
			operator: false,
			buttons: ['del'],
			permission: ['dx-func-admin/logs/del'],
		},
	],
});

const table = ref();
onLoad(() => {
	nextTick(() => {
		// 加载表单数据
		table.value.getTableList();
	});
});
</script>

<style lang="scss"></style>
